import buildingApi from '@/config/server/api/building'
import userApi from '@/config/server/api/user'
import baseApi from '@/config/server/api/base'
import dt from '@dt/dt'
//获取案场详情
function housesGetDetail(params) {
  return buildingApi.basicInformation.housesGetDetail.fetch(params).then((res) => {
    // let projectArr = [],
    //   womenCollegeArr = []
    // res.projectList.length > 0 &&
    //   res.projectList.map((itemT) => {
    //     projectArr.push(itemT.userName + '(' + itemT.workNo + ')')
    //   })
    // res.projectStr = projectArr.join(',')

    // res.womenCollegeList.length > 0 &&
    //   res.womenCollegeList.map((itemT) => {
    //     womenCollegeArr.push(itemT.userName + '(' + itemT.workNo + ')')
    //   })
    // res.womenCollegeStr = womenCollegeArr.join(',')
    return res
  })
}
//编辑案场
function housesEdit(params) {
  return buildingApi.basicInformation.housesEdit.fetch(params)
}
//编辑案场
function housesEditBaseInfo(params) {
  return buildingApi.basicInformation.housesEditBaseInfo.fetch(params)
}
//编辑案场状态
function housesEditStatus(params) {
  return buildingApi.basicInformation.housesEditStatus.fetch(params)
}

//案场组织架构：修改
function updBuildingOrg(params) {
  return userApi.updBuildingOrg.fetch(params)
}
//案场组织架构：查询案场对应业务组织架构
function getBuildingOrgName(params) {
  return userApi.getBuildingOrgName.fetch(params)
}
//查询楼盘状态修改记录
function selectHousesStatusLog(params) {
  return buildingApi.basicInformation.selectHousesStatusLog.fetch(params)
}

function buildingCopyFun(params) {
  return baseApi.buildingCopy.buildingCopy.fetch(params)
}

export default {
  housesGetDetail,
  housesEdit,
  housesEditBaseInfo,
  housesEditStatus,
  updBuildingOrg,
  getBuildingOrgName,
  selectHousesStatusLog,
  buildingCopyFun
}
